import { reactive, ref } from "vue";

export default function InitHook() {
  const tableRef = ref<any>(null);
  const loading = ref<boolean>(false);
  const searchForm = reactive<WarehouseApprove.SearchForm>({
    pageNum: 1,
    pageSize: 10,
    beforePageNum: 0,
    total: 0,
    warehouseBillNumList: "",
    customerIdList: [],
    companyId: "",
    channelIdList: [],
    state: "",
    bizIdList: [],
    followIdList: [],
    finIdList: [],
    depositTime: []
  });
  const tableData = ref<Array<WarehouseApprove.ListRows>>([]);
  const drawerOpts = reactive<Base.DrawerOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });
  const dialogOpts = reactive<Base.DialogOpts>({
    title: "",
    width: "520px",
    component: "",
    visible: false,
    type: 1,
    passData: {}
  });

  return {
    searchForm,
    tableRef,
    tableData,
    drawerOpts,
    loading,
    dialogOpts
  };
}
